package com.zzsy.carosshopprojects.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.king.base.adapter.ViewHolderRecyclerAdapter;
import com.king.base.adapter.holder.ViewHolder;
import com.yatoooon.screenadaptation.ScreenAdapterTools;
import com.zzsy.carosshopprojects.R;
import com.zzsy.carosshopprojects.bean.HomePageBean;

import java.util.List;

/**
 * 主页列表适配器
 */
public class HomePageAdapter extends ViewHolderRecyclerAdapter<HomePageBean> {


    public HomePageAdapter(Context context, List<HomePageBean> listData, int layoutId) {
        super(context, listData, layoutId);
    }

    @Override
    public View buildConvertView(LayoutInflater layoutInflater, ViewGroup parent, int viewType) {
        View view = layoutInflater.inflate(R.layout.adapter_homepage, null);
        ScreenAdapterTools.getInstance().loadView(view);
        return view;
    }

    @Override
    public void bindViewDatas(ViewHolder helper, HomePageBean bean, int positions) {
        helper.setImageResource(R.id.img_home_item, bean.getIcon());
    }




}
